/*
 * @Author: yangrongxin
 * @Date: 2021-08-10 10:08:53
 * @LastEditors: yangrongxin
 * @LastEditTime: 2021-08-10 14:57:48
 */
import { View, Text, Image } from '@tarojs/components';
import { useSafeArea } from '@/hooks/index';
import styles from './index.module.less';

const CustomTitle = (props) => {
  const { showTitle } = props;

  const [safeTop] = useSafeArea();

  return (
    <View
      className={styles.container}
      style={{
        marginTop: `${safeTop + 4}px`,
      }}
    >
      {showTitle ? (
        <Text>华西心理</Text>
      ) : (
        <Image src="https://hxgywx.oss-cn-shenzhen.aliyuncs.com/hxt-wxminiprogram/home_header_title.png" />
      )}
    </View>
  );
};

export default CustomTitle;
